Current Location: Home> Function Categories> time

time

Return the current Unix timestamp
Name:time
Category:Date and time
Programming Language:php
One-line Description:Returns the Unix timestamp of the current time.

Definition and usage

time() function returns the number of seconds of the current time since the Unix epoch (January 1 1970 00:00:00 GMT).

Example

Returns the Unix timestamp of the current time and formats it as a date:

 <?php
$t = time ( ) ;
echo ( $t . "<br>" ) ;
echo ( date ( "Ymd" , $t ) ) ;
?>

Try it yourself

grammar

 time ( ) ;
Similar Functions
Popular Articles